 <html>
 <head>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
     <script type="text/Javascript">
    $(document).ready(function(){ 
	  
              $("#r_button").click(function() {	
				   $(".error").hide();
              $(".common").css("background", "#FFFFFF");
				});
           $("#s_button").click(function() {
                $(".error").hide();
				 
                var oldpass=$("#oldpass").val();
                var newpass=$("#newpass").val();
				var confnewpass=$("#confnewpass").val();
				  
				 	  
	     if(oldpass=="")
	        {
		    $("#oldpass").css("background", "#DB5C04");
			$("#oldpass").focus();
		    
		   return false;
	        }
			else{
			$("#oldpass").css("background", "#FFFFFF");
			}
		   if(newpass=="")
	        {
		  $("#newpass").css("background", "#DB5C04");
		  $("#newpass").focus();
		   
		   return false;
	       }else{
			$("#newpass").css("background", "#FFFFFF");
			}
		   if(confnewpass=="")
	        {
		  $("#confnewpass").css("background", "#DB5C04");
		  $("#confnewpass").focus();
		    
		   return false;
	       }else{
			$("#confnewpass").css("background", "#FFFFFF");
			   }
		  if(newpass!=confnewpass)
	        {
	
		  $("#blankError").show();
		  $("#confnewpass").css("background", "#DB5C04");
		  $("#confnewpass").focus();

		  return false;
	      }

           });
			
			 });

 </script>
 </head>

<body>
<form name="form3" method="post" action="<?php echo MAIN_URL;?>index.php/loginsuccess/updatepassword">
  
   <label>Old Password</label>
          <input type="text" name="oldpass" id="oldpass" class="common">
           <label>New Password</label>
          <input type="text" name="newpass" id="newpass" class="common">
		  <label>Confirm Password</label>
          <input type="text" name="confnewpass" id="confnewpass" class="common">
  
             <input value="Clear" type="reset" id="r_button">
		  <input value="Submit" type="submit" id="s_button">
   <div id="messages" height="200px" width="200px">
  <div class="error" id="result" style="display:none">
   
  </div>
  
  
  <div class="error" style="display:none;" id="blankError">
  <label style='float: left; width: 171px; font-size: 13px;'>
  Password doesn't matched</label></div>
</div>
 
              <?php
               if($this->session->flashdata('password_response'))
                  {
					 
      echo "<label class='error' style='float: left; margin-top: 12px;width: 191px; font-size: 16px; color: #04739D;'>";
	  echo $this->session->flashdata('password_response');
      echo"</label>";
	  unset($_SESSION['password_response']);
	  
                   }
				  
				   
				   
				   ?>
   
  
 
</form>
</body>
</html>
                   